package com.baizhi.hospital.test.service;

import com.baizhi.hospital.dao.ExamDao;
import com.baizhi.hospital.dao.FilesDao;
import com.baizhi.hospital.entity.Files;
import com.baizhi.hospital.service.DrugService;
import com.baizhi.hospital.service.ExamService;
import com.baizhi.hospital.service.FilesService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

public class Service {
    @Autowired
    private DrugService drugService;
    @Autowired(required = false)
    private ExamDao examDao;
    @Autowired
    private ExamService examService;
    @Autowired
    private FilesService filesService;
    @Autowired(required = false)
    private FilesDao filesDao;

    @Test
    public void testDrugPage(){
        Map map = drugService.selectDrugByPage(1, 10, null);
        for (Object o : map.keySet()) {
            System.out.println(o);
        }
    }
    @Test
    public void testExamPage(){
        /*List<Exam> exams = examDao.selectExamByPage(0, 10);
        for (Exam exam : exams) {
            System.out.println(exam);
        }*/
        Map map = examService.selectExamByPage(1, 10);
        System.out.println(map);
    }
    @Test
    public void testFilesPage(){
       /* Map map = filesService.selectFilesByPage(1, 10, null);
        System.out.println(map);*/
        List<Files> files = filesDao.selectFilesByPage(1, 5, "猪");
        for (Files file : files) {
            System.out.println(file);
        }
    }
}
